#include <iostream>
#include <queue>
#include <set>
using namespace std;

struct S {   
    int a[81];  
};
S node; 
queue<S> q;
int gong[9][9]={{0,1,2,9,10,11,18,19,20},  //nine gong 
			{3,4,5,12,13,14,21,22,23},
            {6,7,8,15,16,17,24,25,26},
			{27,28,29,36,37,38,45,46,47},
			{30,31,32,39,40,41,48,49,50},
			{33,34,35,42,43,44,51,52,53},
			{54,55,56,63,64,65,72,73,74},
			{57,58,59,66,67,68,75,76,77},
			{60,61,62,69,70,71,78,79,80}}; 
			
bool check(int a[]) {  // recive a[0],a[1].....a[80]  
	set<int> s;  
	for(int i=0;i<9;i++) {   // row 
		s.clear(); 
		for(int j=0;j<9;j++) {
			if(a[i*9+j]>0) {
				if (s.count(a[i*9+j]))
					return false;
				s.insert(a[i*9+j]);
			}
		} 
	}
	for(int i=0;i<9;i++) {   // col 
		s.clear(); 
		for(int j=0;j<9;j++) {
			if(a[i+j*9]>0) {
				if (s.count(a[i+j*9]))
					return false;
				s.insert(a[i+j*9]);
			}	
		} 
	}
	for(int i=0;i<9;i++) {  // nine gong
		s.clear(); 
		for(int j=0;j<9;j++) {
			if(a[gong[i][j]]>0) {
				if (s.count(a[gong[i][j]]))
					return false;
				s.insert(a[gong[i][j]]);
			}		
		} 
	}
	return true;
}

void print(int a[]) {    // print  
	cout << "a complete success !" << endl;
	cout <<"----------------------"<<endl;
    for(int i = 0; i < 9; i++) {
        for(int j = 0; j < 9; j++) {
            cout << a[i*9+j] << " ";
            if((j+1) % 3 == 0)  cout << "| ";
        }
        cout << endl;
        if(i==2 || i==5)  cout << "----------------------|"<<endl;
    }
}

int main() {
    freopen("case1.in","r",stdin);  
	int step =0 ;   
    for(int i = 0; i < 81; i++) {  //read a[0]...a[80] 
    	char c;
    	cin >> c;
    	if (c=='.') {
    		node.a[i] = 0; 
			step++;   
		} else {
			node.a[i] = c - '0';  
		}
    }
    if (step) {
    	cout << "solving data ." << endl;
	} else {
		cout << "no input file." << endl;
		return 0;
	}
    bool flag = false;
    q.push(node);    
    while( !q.empty()) {  // bfs
    	node = q.front();   
        q.pop();			
        int num = -1;
		for(int i=0;i<81;i++) { // find next
			if(node.a[i]==0) {
				num = i;
				break;
			} 	
		}
		if(num == -1) {	 
			print(node.a);   
			flag = true;  // win 
			break;	
        }
        for(int i = 1; i <= 9; i++) {  
            node.a[num] = i;
            if (check(node.a)) {  // if  true
            	q.push(node);     
			}	
        }
	}
	if (!flag) cout << "no answer." << endl;  
    return 0;
}
